<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<html>
<head>
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css"/>
    <script type="text/javascript" src="/scripts/function-manage.js"></script>
</head>

<body>
<%@ include file="/WEB-INF/manage/common/head.jsp" %>
<%@ include file="/WEB-INF/manage/common/position.jsp" %>
<div id="main" class="wrap">
    <%@include file="/WEB-INF/manage/common/left.jsp" %>
    <div class="main">
        <h2>订单管理</h2>
        <div class="manage">
            <div class="search">
                <form method="post" action="/order/list">
                    订单号：<input type="text" class="text" value="${order.id}" name="id"/>
                    订货人：<input type="text" class="text" name="userName" value="${order.userName}"/> <label
                        class="ui-blue"><input type="submit" name="submit" value="查询"/></label>
                </form>
            </div>
            <div class="spacer"></div>
            <table class="list">
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>发货地址</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>

                <c:forEach items="${orderPage.records}" var="order">
                    <tr>
                        <td class="first w4 c">${order.id}</td>
                        <td class="w1 c">${order.userName}</td>
                        <td>${order.userAddress}</td>
                        <td class="w1 c">
                            <c:choose>
                                <c:when test="${order.status == 1}">下单</c:when>
                                <c:when test="${order.status == 2}">审核通过</c:when>
                                <c:when test="${order.status == 3}">配货</c:when>
                                <c:when test="${order.status == 4}">送货中</c:when>
                                <c:when test="${order.status == 5}">收获并确认</c:when>
                            </c:choose>
                        </td>
                        <td class="w1 c"><a href="/order/update_input?id=${order.id}">修改</a> <a
                                href="javascript:Delete('/order/delete?id=${order.id}');">删除</a></td>
                    </tr>
                </c:forEach>

            </table>
            <div class="pager">

                <ul class="clearfix">
                    <li><a href="/order/list?current=${orderPage.hasPrevious()?orderPage.current-1:1}">上一页</a></li>
                    <c:forEach var="index" begin="1" end="${totalPage}" step="1">
                        <li class="current"><a href="/order/list?current=${index}">${index}</a></li>
                    </c:forEach>
                    <li>
                        <a href="/order/list?current=${orderPage.hasNext()?orderPage.current+1:totalPage}">下一页</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<%@ include file="/WEB-INF/common/footer.jsp" %>
</body>
</html>